
<script type="text/javascript" charset="utf-8">

		var computerroom_id;
		var rackspace_id;
		var hardware_manufacturer;
		var hardware_name;
		var hardwarestatus_id;
		var department_id;
		var opersgroup_id;
		var opersgroupproject_id;
		var applicationtype_id;
		var switch_id1;
		var switch_id2;
		var switch_id3;
		var switch_id4;
		var switch_id5;
		$(function(){
			
			computerroom_id = $('#computerroom_id').combobox({
				url:'/idcpost/computerroominfo',
				valueField:'id',
				textField:'cr_name',
				editable:false,
				panelHeight:'150',
				required:true,
				value:'{{=computerroom_id}}',
				onSelect:function(record){
					rackspace_id.combobox({
						url:'/idcpost/rackspaceinfo?id='+record.id,
						valueField:'id',
						textField:'rackspace_name',
						editable:false,
						panelHeight:'150',
						required:true,
					}).combobox('clear');
					
					switch_id1.combobox({
						url:'/devicespost/switchinfo?id='+record.id,
						valueField:'id',
						textField:'switch_aliasname',
						editable:false,
						panelHeight:'150',
						//required:true
					}).combobox('clear');
					
					switch_id2.combobox({
						url:'/devicespost/switchinfo?id='+record.id,
						valueField:'id',
						textField:'switch_aliasname',
						editable:false,
						panelHeight:'150',
						//required:true
					}).combobox('clear');
					
					switch_id3.combobox({
						url:'/devicespost/switchinfo?id='+record.id,
						valueField:'id',
						textField:'switch_aliasname',
						editable:false,
						panelHeight:'150',
						//required:true
					}).combobox('clear');
					
					switch_id4.combobox({
						url:'/devicespost/switchinfo?id='+record.id,
						valueField:'id',
						textField:'switch_aliasname',
						editable:false,
						panelHeight:'150',
						//required:true
					}).combobox('clear');
					
					switch_id5.combobox({
						url:'/devicespost/switchinfo?id='+record.id,
						valueField:'id',
						textField:'switch_aliasname',
						editable:false,
						panelHeight:'150',
						//required:true
					}).combobox('clear');

				}
			});

			rackspace_id = $('#rackspace_id').combobox({
				url:'/idcpost/rackspaceinfo?id={{=computerroom_id}}',
				valueField:'id',
				textField:'rackspace_name',
				editable:false,
				required:true,
				value:'{{=rackspace_id}}'
			});
			//交换机
			switch_id1 = $('#switch_id1').combobox({
				url:'/devicespost/switchinfo?id={{=computerroom_id}}',
				valueField:'id',
				textField:'switch_aliasname',
				editable:false,
				value:'{{=switch_id1}}'
			});
			switch_id2 = $('#switch_id2').combobox({
				url:'/devicespost/switchinfo?id={{=computerroom_id}}',
				valueField:'id',
				textField:'switch_aliasname',
				editable:false,
				value:'{{=switch_id2}}'
			});
			switch_id3 = $('#switch_id3').combobox({
				url:'/devicespost/switchinfo?id={{=computerroom_id}}',
				valueField:'id',
				textField:'switch_aliasname',
				editable:false,
				value:'{{=switch_id3}}'
			});
			switch_id4 = $('#switch_id4').combobox({
				url:'/devicespost/switchinfo?id={{=computerroom_id}}',
				valueField:'id',
				textField:'switch_aliasname',
				editable:false,
				value:'{{=switch_id4}}'
			});
			switch_id5 = $('#switch_id5').combobox({
				url:'/devicespost/switchinfo?id={{=computerroom_id}}',
				valueField:'id',
				textField:'switch_aliasname',
				editable:false,
				value:'{{=switch_id5}}'
			});
			hardware_manufacturer = $('#hardware_manufacturer').combobox({
				url:'/devicespost/hardware_manufacturerinfo',
				valueField:'id',
				textField:'hardware_manufacturer',
				editable:false,
				panelHeight:'150',
				required:true,
				value:'{{=hardware_manufacturer}}',
				onSelect:function(record){
					hardware_name.combobox({
						url:'/devicespost/hardware_nameinfo?manufacturer='+record.hardware_manufacturer,
						valueField:'id',
						textField:'hardware_name',
						editable:false,
						panelHeight:'150',
						required:true
					}).combobox('clear');
					//rackspace_id.combobox().combobox('clear');
				}
			});

			hardware_name = $('#hardware_name').combobox({
				url:'/devicespost/hardware_nameinfo?manufacturer={{=hardware_manufacturer}}',
				valueField:'id',
				textField:'hardware_name',
				editable:false,
				required:true,
				value:'{{=hardware_id}}'
			});
			
			//状态信息
			hardwarestatus_id = $('#hardwarestatus_id').combobox({
				url:'/devicespost/hardwarestatusinfo',
				valueField:'id',
				textField:'hardwarestatus_name',
				editable:false,
				required:true,
				panelHeight:'150',
				value:'{{=hardwarestatus_id}}',
				onSelect:function(record){  
				   $.ajax({            
						  type:"POST",   //post提交方式默认是get
						  url:"/devicespost/hardwarestatus_hasapp", 
						  dataType:"json",
						  data:{hardwarestatus_id:record.id},        
						  error:function(request) {      // 设置表单提交出错                 
							  alert("请求出错");  //登录错误提示信息
						  },
						  success:function(data) {
							  //网络设备就显示tr
							  if(data.hasapp == 1){
								  //document.getElementById("tr_hardware_port_num").style.display="inline";
								  $("#tr_applicationtype_id").show();

							  }else{
								  //document.getElementById("tr_hardware_port_num").style.display="none";
								  $("#tr_applicationtype_id").hide();
								  $('#department_id').combobox({
										required: false,
									}).combobox('clear');
								  $('#opersgroup_id').combobox({
										required: false,
									}).combobox('clear');
								  $('#opersgroupproject_id').combobox({
										required: false,
									}).combobox('clear');
								  $('#applicationtype_id').combobox({
										required: false,
									}).combobox('clear');
								  }
						  }         
					}); 
				}
			});
			
			department_id = $('#department_id').combobox({
				  url:'/operationpost/departmentinfo',
				  valueField:'id',
				  textField:'department_name',
				  editable:false,
				  required:false,
				  panelHeight:'150',
				  onSelect:function(record){
					  opersgroupproject_id.combobox('clear');
					  applicationtype_id.combobox().combobox('clear');
					  opersgroup_id.combobox({
						  url:'/operationpost/opersgroupinfo?id='+record.id,
						  //method:'get',
						  valueField:'id',
						  textField:'opersgroup_name',
						  editable:false,
						  panelHeight:'150',
						  required:false,
						  onSelect:function(opersgroup_record){
							  opersgroupproject_id.combobox('clear');
							  applicationtype_id.combobox().combobox('clear');
							  opersgroupproject_id.combobox({
								  url:'/operationpost/opersgroupprojectinfo?id='+opersgroup_record.id,
								  valueField:'id',
								  textField:'ogproject_name',
								  editable:false,
								  panelHeight:'150',
								  required:false,
								  onSelect:function(record){
									  applicationtype_id.combobox({
										  url:'/operationpost/applicationtypeinfo?id='+record.id,
										  valueField:'id',
										  textField:'applicationtype_name',
										  editable:false,
										  panelHeight:'150',
										  required:false
									  }).combobox('clear');
								  }
							  }).combobox('clear');	
						  }

					  }).combobox('clear');
				  }
			}).combobox('clear');
			
			if('{{=has_app}}' == '1'){
				
				$("#tr_applicationtype_id").show();
				department_id = $('#department_id').combobox({
					url:'/operationpost/departmentinfo',
					valueField:'id',
					textField:'department_name',
					editable:false,
					required:false,
					value:'{{=department_id}}',
				});
				opersgroupproject_id = $('#opersgroupproject_id').combobox({
					url:'/operationpost/opersgroupprojectinfo?id={{=opersgroup_id}}',
					valueField:'id',
					textField:'ogproject_name',
					editable:false,
					required:false,
					value:'{{=opersgroupproject_id}}'
				});
				opersgroup_id = $('#opersgroup_id').combobox({
					url:'/operationpost/opersgroupinfo?id={{=department_id}}',
					valueField:'id',
					textField:'opersgroup_name',
					editable:false,
					required:false,
					value:'{{=opersgroup_id}}'
				});
				
				applicationtype_id = $('#applicationtype_id').combobox({
					url:'/operationpost/applicationtypeinfo?id={{=opersgroupproject_id}}',
					valueField:'id',
					textField:'applicationtype_name',
					editable:false,
					required:false,
					value:'{{=applicationtype_id}}'
				});
			}
			
			opersgroupproject_id = $('#opersgroupproject_id').combobox({
				valueField:'id',
				textField:'ogproject_name',
				editable:false,
				required:false,
			});
			opersgroup_id = $('#opersgroup_id').combobox({
				valueField:'id',
				textField:'opersgroup_name',
				editable:false,
				required:false,
			});
			
			applicationtype_id = $('#applicationtype_id').combobox({
				valueField:'id',
				textField:'applicationtype_name',
				editable:false,
				required:false,
			});
			
			//是否包含CDROM
			$('#server_cdrom').combobox({
				valueField: 'id',
				textField: 'value',
				data: [{
					id: '0',
					value: '否'
				},{
					id: '1',
					value: '是'
				}],
				required: true,
				panelHeight:'auto',
				value:'{{=server_cdrom}}'				
			});

			//保修状态，过保就隐藏过保日期
			$('#hardwarewarranty_id').combobox({
				url:'/devicespost/hardwarewarrantyinfo',
				valueField: 'id',
				textField: 'hardwarewarranty_name',
				required: true,
				panelHeight:100,
				value:'{{=hardwarewarranty_id}}'
				/*
				onSelect:function(record){
					if(record.id=='0'){
						$("#tr_server_warranty_datetime").hide();
						$('#server_warranty_datetime').datetimebox({
							required: false,
						}).datetimebox('clear');
					}else{
						$("#tr_server_warranty_datetime").show();
						$('#server_warranty_datetime').datetimebox({
							required: true,
						}).datetimebox('clear');
					}
				}*/
				
			});
			
			//网卡类型
			$('#ethernet_type1').combobox({
				valueField: 'id',
				textField: 'value',
				data: [{
					id: '0',
					value: '虚拟'
				},{
					id: '1',
					value: '物理'
				}],
				panelHeight:'50',
				value:'{{=ethernet_type1}}'
			});
			$('#ethernet_type2').combobox({
				valueField: 'id',
				textField: 'value',
				data: [{
					id: '0',
					value: '虚拟'
				},{
					id: '1',
					value: '物理'
				}],
				panelHeight:'50',
				value:'{{=ethernet_type2}}'
			});
			$('#ethernet_type3').combobox({
				valueField: 'id',
				textField: 'value',
				data: [{
					id: '0',
					value: '虚拟'
				},{
					id: '1',
					value: '物理'
				}],
				panelHeight:'50',
				value:'{{=ethernet_type3}}'
			});
			$('#ethernet_type4').combobox({
				valueField: 'id',
				textField: 'value',
				data: [{
					id: '0',
					value: '虚拟'
				},{
					id: '1',
					value: '物理'
				}],
				panelHeight:'50',
				value:'{{=ethernet_type4}}'
			});			
			$('#ethernet_type5').combobox({
				valueField: 'id',
				textField: 'value',
				data: [{
					id: '0',
					value: '虚拟'
				},{
					id: '1',
					value: '物理'
				}],
				panelHeight:'50',
				value:'{{=ethernet_type5}}'
			});
			
			$('input[title]').qtip({
				 show: 'focus',
				 hide: 'blur',
				 style: {
						classes: 'qtip-blue qtip-bootstrap'
					},
				 content: {
						//text: 'I really like owls!',
						title: '示例(不要带单位)'
					},
				 position: {
					//my: 'top left',  // Position my top left...
					at: 'bottom center', // at the bottom right of...
					//target: $('input[title]') // my target
				}
			 });
									
		});
		
		//添加行
		 function addRowByID(currentRowID,name,text,validType){
		   //遍历每一行，找到指定id的行的位置i,然后在该行后添加新行
		   $.each( $('#tb:first tbody tr'), function(i, tr){
			   //$("tr").each(function(i, tr){
			   if($(this).attr('id')==currentRowID){
				   //获取当前行
				   var currentRow=$('#tb:first tbody tr:eq('+i+')');
				   //var currentRow=$('tr:eq('+i+')');
				   //要添加的行的id
				   var addRowID=currentRowID+1;
					str = "<tr><th style='width: 80px;'>"+
							text+"</th><td><input name='"+ name +"' class='easyui-validatebox'"+
							" data-options=\"required:'true',validType:'" + validType + "'\" style='width: 400px;' />"+
							"<input type='button' name='button' value='删除' onclick='delRowByID(this);' style='width: 50px;'>"+
							"</td></tr>";
				   //当前行之后插入一行
				   currentRow.after(str);
				   //保证easyui验证可以使用
				   $.parser.parse();
				   return false; //停止循环
			   }
		   });
	   }  

   		//删除行
		function delRowByID(clickTd){
			var tr = $(clickTd).parent().parent();
			tr.remove();
		}
</script>

<div style="padding: 5px;">
	<form method="post">
    	<input type="hidden" name="id" />
		<table class="tableForm" id="tb" name="tb" >
			<tr>
                  <th style="width:80px;">机房机柜</th>
                  <td>
                  	<input style="line-height:26px;border:1px solid #ccc;width:130px" class="easyui-combobox" 
                        name="computerroom_id" id="computerroom_id" />                    
                    <input style="line-height:26px;border:1px solid #ccc;width:140px" class="easyui-combobox" 
                        name="rackspace_id" id="rackspace_id" />
                  </td>
			</tr>
            <tr>
				<th style="width: 80px;">设备型号</th>
				<td>
               		<input style="line-height:26px;border:1px solid #ccc;width:130px" class="easyui-combobox" 
                        name="hardware_manufacturer" id="hardware_manufacturer" />                    
                    <input style="line-height:26px;border:1px solid #ccc;width:140px" class="easyui-combobox" 
                        name="hardware_name" id="hardware_name" />
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">序列号</th>
				<td><input name="server_sn" class="easyui-validatebox" data-options="required:'true'" style="width: 400px;" />
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">资产编号</th>
				<td><input name="server_asset_tag" class="easyui-validatebox" data-options="required:'true'" style="width: 400px;" />
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">设备U数</th>
				<td><input name="server_height" class="easyui-numberbox" data-options="required:'true',min:1,max:99" style="width: 400px;" />
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">主机名</th>
				<td><input name="system_hostname" class="easyui-validatebox" data-options="required:'true'" style="width: 400px;" />
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">是否包含CDROM</th>
				<td><input id="server_cdrom" class="easyui-combobox" name="server_cdrom" style="width:200px;"/>
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">RAID卡型号</th>
				<td><input name="server_raidtype" style="width: 400px;" />
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">保修状态</th>
				<td><input id="hardwarewarranty_id" class="easyui-combobox" name="hardwarewarranty_id" style="width:200px;"/>
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">保修到期日</th>
				<td>
                <input class="easyui-datetimebox" id="server_warranty_datetime" name="server_warranty_datetime" 
        data-options="showSeconds:false" style="width:150px" />
        		<!--<input class="Wdate" type="text" id="server_warranty_datetime" name="server_warranty_datetime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="width:150px">-->
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">采购价格</th>
				<td><input name="server_price" class="easyui-numberbox" data-options="precision:2" style="width: 400px;" />
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">采购负责人</th>
				<td><input name="server_purchasing_director" style="width: 400px;" />
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">采购日期</th>
				<td>
                <input class="easyui-datetimebox" name="server_buy_datetime" 
        data-options="showSeconds:false" style="width:150px" />
        		<!--<input class="Wdate" type="text" id="server_buy_datetime" name="server_buy_datetime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="width:150px">-->
				</td>
			</tr>
           {{if cpu_num == 0:}}
           <tr id="tr_server_cpu">
				<th style="width: 80px;">CPU信息</th>
				<td><input id="server_cpu" name="server_cpu" class="easyui-validatebox" style="width: 400px;" data-options="validType:'cpu'" title="E5504*2000*2"/><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_cpu','server_cpu','CPU信息','cpu');" style="width: 50px;"> 格式：型号*频率*物理数
				</td>
			</tr>
            {{else:
            	count = 1
                for i in cpu:
                	if count == 1:
            }}
             <tr id="tr_server_cpu">
				<th style="width: 80px;">CPU信息</th>
				<td><input id="server_cpu" name="server_cpu" class="easyui-validatebox" style="width: 400px;" data-options="validType:'cpu'" value="{{=i.servercpu_type}}*{{=i.servercpu_hz}}*{{=i.servercpu_num}}" title="E5504*2000*2"/><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_cpu','server_cpu','CPU信息','cpu');" style="width: 50px;"> 格式：型号*频率*物理数
				</td>
			</tr>
            {{		else:}}
            <tr>
				<th style="width: 80px;">CPU信息</th>
				<td><input id="server_cpu" name="server_cpu" class="easyui-validatebox" style="width: 400px;" data-options="validType:'cpu'" value="{{=i.servercpu_type}}*{{=i.servercpu_hz}}*{{=i.servercpu_num}}" title="E5504*2000*2"/><input type="button" name="button" value="删除" onclick="delRowByID(this);" style="width: 50px;">
				</td>
			</tr>
            {{pass}}
            {{count = count + 1
            pass}}
            {{pass}}
            
           {{if mem_num == 0:}}
           <tr id="tr_server_mem">
				<th style="width: 80px;">内存信息</th>
				<td><input id="server_mem" name="server_mem" class="easyui-validatebox" style="width: 400px;" data-options="validType:'mem'" title="DDR3*1333*512*1<br>DDR3*1333*2G*1<br>DDR3*1333*512M*1<br>内存大小不写单位默认M"/><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_mem','server_mem','内存信息','mem');" style="width: 50px;"> 格式：型号*频率*单条容量*数量
				</td>
			</tr>
            {{else:
            	count = 1
                for i in mem:
                	if count == 1:
            }}
           <tr id="tr_server_mem">
				<th style="width: 80px;">内存信息</th>
				<td><input id="server_mem" name="server_mem" class="easyui-validatebox" style="width: 400px;" data-options="validType:'mem'" value="{{=i.servermem_type}}*{{=i.servermem_hz}}*{{=i.servermem_size}}*{{=i.servermem_num}}" title="DDR3*1333*512*1<br>DDR3*1333*2G*1<br>DDR3*1333*512M*1<br>内存大小不写单位默认M"/><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_mem','server_mem','内存信息','mem');" style="width: 50px;"> 格式：型号*频率*单条容量*数量
				</td>
			</tr>
            {{		else:}}
           <tr id="tr_server_mem">
				<th style="width: 80px;">内存信息</th>
				<td><input id="server_mem" name="server_mem" class="easyui-validatebox" style="width: 400px;" data-options="validType:'mem'" value="{{=i.servermem_type}}*{{=i.servermem_hz}}*{{=i.servermem_size}}*{{=i.servermem_num}}" title="DDR3*1333*512*1<br>DDR3*1333*2G*1<br>DDR3*1333*512M*1<br>内存大小不写单位默认M"/><input type="button" name="button" value="删除" onclick="delRowByID(this);" style="width: 50px;">
				</td>
			</tr>
            {{pass}}
            {{count = count + 1
            pass}}
            {{pass}}

           {{if disk_num == 0:}}
           <tr id="tr_server_disk">
				<th style="width: 80px;">硬盘信息</th>
				<td><input id="server_disk" name="server_disk" class="easyui-validatebox" style="width: 400px;" data-options="validType:'disk'" title="SAS*15000*100*1<br>SAS*15000*100G*1<br>SAS*7500*100T*1<br>SAS*7500*100P*1<br>硬盘大小不写单位默认G"/><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_disk','server_disk','硬盘信息','disk');" style="width: 50px;"> 格式：型号*转速*单盘容量*数量
				</td>
			</tr>
            {{else:
            	count = 1
                for i in disk:
                	if count == 1:
            }}
           <tr id="tr_server_disk">
				<th style="width: 80px;">硬盘信息</th>
				<td><input id="server_disk" name="server_disk" class="easyui-validatebox" style="width: 400px;" data-options="validType:'disk'" value="{{=i.serverdisk_type}}*{{=i.serverdisk_speed}}*{{=i.serverdisk_size}}*{{=i.serverdisk_num}}" title="SAS*15000*100*1<br>SAS*15000*100G*1<br>SAS*7500*100T*1<br>SAS*7500*100P*1<br>硬盘大小不写单位默认G"/><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_disk','server_disk','硬盘信息','disk');" style="width: 50px;"> 格式型号*转速*单盘容量*数量
				</td>
			</tr>
            {{		else:}}
           <tr id="tr_server_disk">
				<th style="width: 80px;">硬盘信息</th>
				<td><input id="server_disk" name="server_disk" class="easyui-validatebox" style="width: 400px;" data-options="validType:'disk'" value="{{=i.serverdisk_type}}*{{=i.serverdisk_speed}}*{{=i.serverdisk_size}}*{{=i.serverdisk_num}}" title="SAS*15000*100*1<br>SAS*15000*100G*1<br>SAS*7500*100T*1<br>SAS*7500*100P*1<br>硬盘大小不写单位默认G"/><input type="button" name="button" value="删除" onclick="delRowByID(this);" style="width: 50px;"> 格式：型号*频率*单条容量*数量
				</td>
			</tr>
            {{pass}}
            {{count = count + 1
            pass}}
            {{pass}}

           {{if power_num == 0:}}
           <tr id="tr_server_power">
				<th style="width: 80px;">电源信息</th>
				<td><input id="server_power" name="server_power" class="easyui-validatebox" style="width: 400px;" data-options="validType:'power'" /><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_power','server_power','电源信息','power');" style="width: 50px;"> 格式：型号*功率*数量
				</td>
			</tr>
            {{else:
            	count = 1
                for i in power:
                	if count == 1:
            }}
           <tr id="tr_server_power">
				<th style="width: 80px;">电源信息</th>
				<td><input id="server_power" name="server_power" class="easyui-validatebox" style="width: 400px;" data-options="validType:'power'" value="{{=i.serverpower_type}}*{{=i.serverpower_kw}}*{{=i.serverpower_num}}"/><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_power','server_power','电源信息','power');" style="width: 50px;"> 格式：型号*功率*数量
				</td>
			</tr>
            {{		else:}}
           <tr id="tr_server_power">
				<th style="width: 80px;">电源信息</th>
				<td><input id="server_power" name="server_power" class="easyui-validatebox" style="width: 400px;" data-options="validType:'power'" value="{{=i.serverpower_type}}*{{=i.serverpower_kw}}*{{=i.serverpower_num}}" /><input type="button" name="button" value="删除" onclick="delRowByID(this);" style="width: 50px;"> 格式：型号*功率*数量
				</td>
			</tr>
            {{pass}}
            {{count = count + 1
            pass}}
            {{pass}}

           {{if eth_num == 0:}}
           <tr id="tr_server_ethernet">
				<th style="width: 80px;">网卡信息</th>
				<td><input id="server_ethernet" name="server_ethernet" class="easyui-validatebox" style="width: 130px;" data-options="validType:'ethernet'" /><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_ethernet','server_ethernet','网卡信息','ethernet');" style="width: 50px;"> 格式：型号*数量
				</td>
			</tr>
            {{else:
            	count = 1
                for i in eth:
                	if count == 1:
            }}
           <tr id="tr_server_ethernet">
				<th style="width: 80px;">网卡信息</th>
				<td><input id="server_ethernet" name="server_ethernet" class="easyui-validatebox" style="width: 130px;" data-options="validType:'ethernet'" value="{{=i.servereth_type}}*{{=i.servereth_num}}" /><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_ethernet','server_ethernet','网卡信息','ethernet');" style="width: 50px;"> 格式：型号*数量
				</td>
			</tr>
            {{		else:}}
           <tr id="tr_server_ethernet">
				<th style="width: 80px;">网卡信息</th>
				<td><input id="server_ethernet" name="server_ethernet" class="easyui-validatebox" style="width: 130px;" data-options="validType:'ethernet'" value="{{=i.servereth_type}}*{{=i.servereth_num}}" /><input type="button" name="button" value="添加" onclick="addRowByID('tr_server_ethernet','server_ethernet','网卡信息','ethernet');" style="width: 50px;"> 格式：型号*数量
				</td>
			</tr>
            {{pass}}
            {{count = count + 1
            pass}}
            {{pass}}
           
			<tr>
                  <th style="width:80px;">状态信息</th>
                  <td>
                  <input style="line-height:26px;border:1px solid #ccc;width:130px" class="easyui-combobox" 
                        name="hardwarestatus_id" id="hardwarestatus_id" />
                  </td>
			</tr>
            <tr id="tr_applicationtype_id" style='display: none'>
				<th style="width: 80px;">应用主题</th>
				<td>
					<input style="line-height:26px;border:1px solid #ccc;width:130px" class="easyui-combobox" 
                        data-options="required:false" name="department_id" id="department_id" />                    
                    <input style="line-height:26px;border:1px solid #ccc;width:120px" class="easyui-combobox" 
                        data-options="required:false" name="opersgroup_id" id="opersgroup_id" />
                    <input style="line-height:26px;border:1px solid #ccc;width:120px" class="easyui-combobox" 
                        data-options="required:false" name="opersgroupproject_id" id="opersgroupproject_id" />
                <input style="line-height:26px;border:1px solid #ccc;width:130px" class="easyui-combobox" 
                		data-options="required:false" id="applicationtype_id" name="applicationtype_id"/>
				</td>
			</tr>
			<tr>
				<th style="width: 80px;">网卡接入配置</th>
				<td>
                	<table>
                	  <thead><tr><td>类型</td><td>设备名</td><td>物理接口</td><td>ip地址</td><td>mac地址</td><td>映射IP</td><td>交换机</td><td>交换机端口</td></tr></thead>
  <tbody>
    				<tr>
                    	<td><input id="ethernet_type1" class="easyui-combobox" name="ethernet_type1" style="width:50px;"/></td>
                        <td><input name="ethernet_dev_name1" value="{{=ethernet_dev_name1}}" class="easyui-validatebox" style="width: 50px;" /></td>
                        <td><input name="ethernet_physical_interface1" value="{{=ethernet_physical_interface1}}" class="easyui-numberbox" style="width: 50px;" /></td>
                     	<td><input name="ethernet_ip1" value="{{=ethernet_ip1}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input name="ethernet_mac1" value="{{=ethernet_mac1}}" class="easyui-validatebox" style="width:100px;"/></td>
                        <td><input name="ethernet_mip1" value="{{=ethernet_mip1}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input id="switch_id1" class="easyui-combobox" name="switch_id1" style="width:100px;"/></td>
                        <td><input name="switchport_id_port1" value="{{=switchport_id_port1}}" class="easyui-numberbox" style="width:50px;"/></td>
                     </tr>
                     <tr>
                    	<td><input id="ethernet_type2" class="easyui-combobox" name="ethernet_type2" style="width:50px;"/></td>
                        <td><input name="ethernet_dev_name2" value="{{=ethernet_dev_name2}}" class="easyui-validatebox" style="width: 50px;" /></td>
                        <td><input name="ethernet_physical_interface2" value="{{=ethernet_physical_interface2}}" class="easyui-numberbox" style="width: 50px;" /></td>
                     	<td><input name="ethernet_ip2" value="{{=ethernet_ip2}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input name="ethernet_mac2" value="{{=ethernet_mac2}}" class="easyui-validatebox" style="width:100px;"/></td>
                        <td><input name="ethernet_mip2" value="{{=ethernet_mip2}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input id="switch_id2" class="easyui-combobox" name="switch_id2" style="width:100px;"/></td>
                        <td><input name="switchport_id_port2" value="{{=switchport_id_port2}}" class="easyui-numberbox" style="width:50px;"/></td>
                     </tr>
                     <tr>
                    	<td><input id="ethernet_type3" class="easyui-combobox" name="ethernet_type3" style="width:50px;"/></td>
                        <td><input name="ethernet_dev_name3" value="{{=ethernet_dev_name3}}" class="easyui-validatebox" style="width: 50px;" /></td>
                        <td><input name="ethernet_physical_interface3" value="{{=ethernet_physical_interface3}}" class="easyui-numberbox" style="width: 50px;" /></td>
                     	<td><input name="ethernet_ip3" value="{{=ethernet_ip3}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input name="ethernet_mac3" value="{{=ethernet_mac3}}" class="easyui-validatebox" style="width:100px;"/></td>
                        <td><input name="ethernet_mip3" value="{{=ethernet_mip3}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input id="switch_id3" class="easyui-combobox" name="switch_id3" style="width:100px;"/></td>
                        <td><input name="switchport_id_port3" value="{{=switchport_id_port3}}" class="easyui-numberbox" style="width:50px;"/></td>
                     </tr>
                     <tr>
                    	<td><input id="ethernet_type4" class="easyui-combobox" name="ethernet_type4" style="width:50px;"/></td>
                        <td><input name="ethernet_dev_name4" value="{{=ethernet_dev_name4}}" class="easyui-validatebox" style="width: 50px;" /></td>
                        <td><input name="ethernet_physical_interface4" value="{{=ethernet_physical_interface4}}" class="easyui-numberbox" style="width: 50px;" /></td>
                     	<td><input name="ethernet_ip4" value="{{=ethernet_ip4}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input name="ethernet_mac4" value="{{=ethernet_mac4}}" class="easyui-validatebox" style="width:100px;"/></td>
                        <td><input name="ethernet_mip4" value="{{=ethernet_mip4}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input id="switch_id4" class="easyui-combobox" name="switch_id4" style="width:100px;"/></td>
                        <td><input name="switchport_id_port4" value="{{=switchport_id_port4}}" class="easyui-numberbox" style="width:50px;"/></td>
                     </tr>
                     <tr>
                    	<td><input id="ethernet_type5" class="easyui-combobox" name="ethernet_type5" style="width:50px;"/></td>
                        <td><input name="ethernet_dev_name5" value="{{=ethernet_dev_name5}}" class="easyui-validatebox" style="width: 50px;" /></td>
                        <td><input name="ethernet_physical_interface5" value="{{=ethernet_physical_interface5}}" class="easyui-numberbox" style="width: 50px;" /></td>
                     	<td><input name="ethernet_ip5" value="{{=ethernet_ip5}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input name="ethernet_mac5" value="{{=ethernet_mac5}}" class="easyui-validatebox" style="width:100px;"/></td>
                        <td><input name="ethernet_mip5" value="{{=ethernet_mip5}}" class="easyui-validatebox" data-options="validType:'ip'" style="width:100px;"/></td>
                        <td><input id="switch_id5" class="easyui-combobox" name="switch_id5" style="width:100px;"/></td>
                        <td><input name="switchport_id_port5" value="{{=switchport_id_port5}}" class="easyui-numberbox" style="width:50px;"/></td>
                     </tr>
  </tbody>
                     </table>
				</td>
			</tr>
            <tr>
				<th style="width: 80px;">备注</th>
				<td colspan="3"><textarea name="comment" style="height: 50px;width: 97%;"></textarea>
				</td>
			</tr>          
		</table>
	</form>
</div>